package cn.bonoon.kernel.events;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.springframework.context.ApplicationContext;

import cn.bonoon.kernel.support.IOperator;

/**
 * 类似于写数据库实体时的操作事件，这里主要是用于共享一些公共的定义
 * @author jackson
 *
 */
public class ReadEvent extends AbstractEvent{
	
//	private AutoLoadFilter filter;
	
	public ReadEvent(ApplicationContext applicationContext, HttpServletRequest request, Object source, IOperator operator) {
		super(applicationContext, request, source, operator);
	}

	public ReadEvent(ApplicationContext applicationContext, HttpServletRequest request, IOperator operator) {
		super(applicationContext, request, null, operator);
	}
	
	public Object getAttribute(String name){
		return request.getSession().getAttribute(name);
	}
	
	public String findFormatString(String ref){
		return "";
	}
	private Date now;
	public Date now(){
		if(null == now) now = new Date();
		return now;
	}

//	public AutoLoadFilter getFilter() {
//		return filter;
//	}
//
//	public void setFilter(AutoLoadFilter filter) {
//		this.filter = filter;
//	}
}
